package com.ordering.entity;

import java.io.Serializable;
import java.util.Set;

/**
 * 订单表实体
 * @author Administrator
 *
 */
public class Order implements Serializable
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int id;
    private int userId;
    private int addrId;
    private String name;
    private String addr;
    private String msisdn;
    private int productMoney;
    private int realMoney;
    private int status;
    private String createTime;
    private String handleTime;
    private String deliverTime;
    private String cancelTime;
    private String overTime;
    private String remark;
    //一对多关联OrderItem
    private Set<OrderItem> items;
    
    /**
     * 排队中
     */
    public static final int STATUS_WAIT = 1;
    /**
     * 处理中
     */
    public static final int STATUS_HANDLE = 2;
    /**
     * 已送出
     */
    public static final int STATUS_DELIVER = 3;
    /**
     * 已结束
     */
    public static final int STATUS_OVER = 4;
    /**
     * 已取消
     */
    public static final int STATUS_CANCEL = 5;
    
    
    public String getStatusDesc(){
    	String desc = "";
    	switch(this.status){
    		case Order.STATUS_WAIT:
    			desc = "排队中";
    			break;
    		case Order.STATUS_HANDLE:
    			desc = "处理中";
    			break;
    		case Order.STATUS_DELIVER:
    			desc = "已送出";
    			break;
    		case Order.STATUS_CANCEL:
    			desc = "已取消";
    			break;
    		case Order.STATUS_OVER:
    			desc = "已结束";
    			break;
    	}
    	
    	
    	return desc;
    }
    
    //获取当前状态的下一步操作
    public String getNextHandleDesc(){
    	String desc = "";
    	switch(this.status){
    		case Order.STATUS_WAIT:
    			desc = "处理";
    			break;
    		case Order.STATUS_HANDLE:
    			desc = "送出";
    			break;
    		case Order.STATUS_DELIVER:
    			desc = "结束";

    	}
    	//结束或取消的订单是没有下一步操作的
    	
    	return desc;
    }
    
    
    public int getId()
    {
        return id;
    }
    public void setId(int id)
    {
        this.id = id;
    }
    public int getUserId()
    {
        return userId;
    }
    public void setUserId(int userId)
    {
        this.userId = userId;
    }
    public int getAddrId()
    {
        return addrId;
    }
    public void setAddrId(int addrId)
    {
        this.addrId = addrId;
    }
    public String getName()
    {
        return name;
    }
    public void setName(String name)
    {
        this.name = name;
    }
    public String getAddr()
    {
        return addr;
    }
    public void setAddr(String addr)
    {
        this.addr = addr;
    }
    public String getMsisdn()
    {
        return msisdn;
    }
    public void setMsisdn(String msisdn)
    {
        this.msisdn = msisdn;
    }
    public int getProductMoney()
    {
        return productMoney;
    }
    public void setProductMoney(int productMoney)
    {
        this.productMoney = productMoney;
    }
    public int getRealMoney()
    {
        return realMoney;
    }
    public void setRealMoney(int realMoney)
    {
        this.realMoney = realMoney;
    }
    public int getStatus()
    {
        return status;
    }
    public void setStatus(int status)
    {
        this.status = status;
    }
    public String getCreateTime()
    {
        return createTime;
    }
    public void setCreateTime(String createTime)
    {
        this.createTime = createTime;
    }
    public String getHandleTime()
    {
        return handleTime;
    }
    public void setHandleTime(String handleTime)
    {
        this.handleTime = handleTime;
    }
    public String getDeliverTime()
    {
        return deliverTime;
    }
    public void setDeliverTime(String deliverTime)
    {
        this.deliverTime = deliverTime;
    }
    public String getCancelTime()
    {
        return cancelTime;
    }
    public void setCancelTime(String cancelTime)
    {
        this.cancelTime = cancelTime;
    }
    public String getOverTime()
    {
        return overTime;
    }
    public void setOverTime(String overTime)
    {
        this.overTime = overTime;
    }
    public String getRemark()
    {
        return remark;
    }
    public void setRemark(String remark)
    {
        this.remark = remark;
    }

	public Set<OrderItem> getItems() {
		return items;
	}

	public void setItems(Set<OrderItem> items) {
		this.items = items;
	}

	

    
}
